<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>日志查看</title>
    <script src="../../../../res/js/jquery-3.4.1.min.js"></script>
    <script src="../../../../res/layui/layui.js" charset="utf-8"></script>
    <script src="../../../../res/js/Tools.js"></script>
    <link rel="stylesheet" href="../../../../res/layui/css/layui.css" media="all">
    <link href="../../../../res/echarts/eleTree.css" rel="stylesheet"/>
    <script src="../../../../res/echarts/eleTree.js"></script>
    <link rel="shortcut icon" type="image/x-icon" href="../../../../res/images/favicon.ico">
    <script src="../../../../res/js/login_common.js" charset="utf-8"></script>
    <style type="text/css">
        body {
            padding: 10px;
        }
        .showFont{
            line-height: 40px;
        }
    </style>
</head>
<body>
<form class="layui-form" action="">
    <input type="hidden" id="logId" name="logId">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">所属模块：</label>
            <div class="layui-input-inline showFont" id="logTitle">

            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">创建日期：</label>
            <div class="layui-input-inline showFont" id="createdTime">

            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">操作人：</label>
            <div class="layui-input-inline showFont" id="createdBy">

            </div>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">详细信息</label>
        <div class="layui-input-block" style="word-break:break-all" id="logBody">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1" id="sub">立即提交</button>
        </div>
    </div>
</form>
<script>
    var houses;
    layui.use(['form', 'layedit', 'laydate', 'layer'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
        // 修改赋值
        var logId = getQueryString("pkLogId");

        //表单取值
        layui.$('#LAY-component-form-getval').on('click', function () {
            var data = form.val('example');
            alert(JSON.stringify(data));
        });


        if (logId) {
            $("#logId").val(logId);
            const res=getAjaxById(getRootPath()+"OaLogAction/findById/" + logId);
            $("#logTitle").html(res.logTitle);          // 所属模块
            $("#logBody").html(res.logBody);            // 详细内容
            $("#createdBy").html(res.createdBy);        // 创建人
            console.info(dateFormat("yyyy-MM-dd hh:mm:ss",new Date(res.createdTime)));
            $("#createdTime").html(dateFormat("yyyy-MM-dd hh:mm:ss",new Date(res.createdTime)));    // 创建时间
        }

        //重新渲染表单函数
        function renderForm() {
            layui.use('form', function () {
                var form = layui.form(); //高版本建议把括号去掉，有的低版本，需要加()
                form.render();
            });
        }

        form.render();
    });
</script>
</body>
</html>